/* GUI CONVERTED from rcctmt.p (converter v1.75) Thu Jul 19 05:34:55 2001 */
/* rcctmt.p - Release Management Customer Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/* $Revision: 1.9.2.8 $                                                         */
/*V8:ConvertMode=Maintenance                                                 */
/* REVISION: 7.3      LAST MODIFIED: 10/12/92   BY: WUG *G462*               */
/* REVISION: 7.3      LAST MODIFIED: 06/01/93   BY: WUG *GB46*               */
/* REVISION: 7.3      LAST MODIFIED: 08/13/93   BY: WUG *GE19*               */
/* REVISION: 7.3      LAST MODIFIED: 09/22/93   BY: WUG *GF25*               */
/* REVISION: 7.3      LAST MODIFIED: 10/19/94   BY: rxm *GN32*               */
/* REVISION: 7.3      LAST MODIFIED: 11/23/94   BY: jxz *GO60*               */
/* REVISION: 8.5      LAST MODIFIED: 11/29/94   BY: mwd *J034*               */
/* REVISION: 7.3      LAST MODIFIED: 05/10/95   BY: dxk *G0MC*               */
/* REVISION: 7.3      LAST MODIFIED: 08/04/95   BY: vrn *G0TN*               */
/* REVISION: 8.5      LAST MODIFIED: 06/11/96   BY: rxm *G1XQ*               */
/* REVISION: 8.6      LAST MODIFIED: 06/03/96   BY: *K003* Vinay Nayak-Sujir */
/* REVISION: 8.6      LAST MODIFIED: 04/02/97   BY: *K09H* Vinay Nayak-Sujir */
/* REVISION: 8.6      LAST MODIFIED: 04/09/97   BY: *K08N* Steve Goeke       */
/* REVISION: 8.6      LAST MODIFIED: 08/27/97   BY: *H1DJ* Suresh Nayak      */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan        */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan        */
/* REVISION: 8.6E     LAST MODIFIED: 08/18/99   BY: *K223* Santosh Rao       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane  */
/* REVISION: 9.1      LAST MODIFIED: 04/13/00   BY: *K250* Surekha Joshi     */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                   */
/* Revision: 1.9.2.7     BY: Jean Miller    DATE: 03/22/01 ECO: *P008*       */
/* $Revision: 1.9.2.8 $   BY: Ellen Borden  DATE: 07/09/01   ECO: *P007* */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* CONTAINER MAINT */

/* ********** Begin Translatable Strings Definitions ********* */

{mfdtitle.i "b+ "} /*GUI moved to top.*/
&SCOPED-DEFINE rcctmt_p_1 "Container ID"
/* MaxLen: Comment: */

&SCOPED-DEFINE rcctmt_p_2 "Ship-To/Dock"
/* MaxLen: Comment: */

&SCOPED-DEFINE rcctmt_p_3 "Ship-From Site"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/*GUI moved mfdeclre/mfdtitle.*/
{rcinvtbl.i new}

define new shared variable so_db like dc_name.
define new shared variable old_site like si_site.
define new shared variable new_site like si_site.
define new shared variable err_stat as integer.

define shared variable global_recid as recid.

define variable disp_abs_id like abs_id.
define variable abs_recid as recid.
define variable del-yn like mfc_logical.
define variable deassign like mfc_logical.
define variable old_gwt like pt_net_wt.
define variable old_nwt like pt_net_wt.
define variable old_vol like abs_vol.
define variable diff_gwt like pt_net_wt.
define variable diff_nwt like pt_net_wt.
define variable diff_vol like abs_vol.
define variable wt_conv as decimal.
define variable vol_conv as decimal.
define variable nullstr as character.
define variable ship_db as character.
define variable disp_id as character.
define variable transtype as character initial "ISS-UNP".
define variable undotran like mfc_logical no-undo.
define variable par_absid like abs_id no-undo.
define variable par_shipfrom like abs_shipfrom no-undo.
define variable l_abs_tare_wt like abs_nwt     no-undo.
define variable vLastField as character no-undo.

/* VARIABLE DEFINITIONS FOR gpfile.i */
 {gpfilev.i}

define buffer abs_mstr_cont for abs_mstr.
define buffer abs_mstr_par for abs_mstr.
define buffer abs_tmp for abs_mstr.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
abs_shipfrom         colon 20 label {&rcctmt_p_3}
   si_desc              at 45 no-label
   abs_id               colon 20 label {&rcctmt_p_1}
   format "x(8)"
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
abs_shipto           colon 20 label {&rcctmt_p_2}
   ad_name              at 45 no-label
   ad_line1             at 45 no-label
 SKIP(.4)  /*GUI*/
with frame b side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-b-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame b = F-b-title.
 RECT-FRAME-LABEL:HIDDEN in frame b = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame b =
  FRAME b:HEIGHT-PIXELS - RECT-FRAME:Y in frame b - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME b = FRAME b:WIDTH-CHARS - .5.  /*GUI*/


/* SET EXTERNAL LABELS */
setFrameLabels(frame b:handle).

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
abs_item             colon 20
   pt_desc1             at 45 no-label
   abs_qty              colon 20 format "->,>>>,>>9.9<<<<<<<<"
   abs_site             colon 20
   abs_loc              colon 20
   loc_desc             at 45 no-label
   abs_lotser           colon 20
   abs_ref              colon 20
   abs_order            colon 20
   abs_line             colon 20
 SKIP(.4)  /*GUI*/
with frame c side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-c-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame c = F-c-title.
 RECT-FRAME-LABEL:HIDDEN in frame c = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame c =
  FRAME c:HEIGHT-PIXELS - RECT-FRAME:Y in frame c - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME c = FRAME c:WIDTH-CHARS - .5.  /*GUI*/


/* SET EXTERNAL LABELS */
setFrameLabels(frame c:handle).

/*DETERMINE IF CONTAINER AND LINE CHARGES ARE ENABLED*/
{cclc.i}

clear frame a all.
clear frame b all.
clear frame c all.

find abs_mstr where recid(abs_mstr) = global_recid no-lock no-error.

if available abs_mstr and abs_id begins "C" and abs_type = "S"
then do:

   find si_mstr where si_site = abs_shipfrom no-lock.

   display
      abs_shipfrom
      si_desc
      substring(abs_id,2,8) @ abs_id
   with frame a.

end.

so_db = global_db.

{gprun.i ""rcpma.p""}
/*GUI*/ if global-beam-me-up then undo, leave.


mainloop:
repeat:
/*GUI*/ if global-beam-me-up then undo, leave.

   do transaction with frame a:
/*GUI*/ if global-beam-me-up then undo, leave.

      prompt-for
         abs_shipfrom
         abs_id
      editing:

         global_site = input abs_shipfrom.

         if frame-field = "abs_shipfrom" then do:

            {mfnp05.i abs_mstr abs_id
               "abs_id begins ""C"" and abs_type = ""S"" "
               abs_shipfrom
               "input abs_shipfrom"}

            if recno <> ? then do:
               find si_mstr where si_site = abs_shipfrom
               no-lock no-error.
               assign
                  disp_abs_id = substring(abs_id,2,8).
               display
                  abs_shipfrom
                  si_desc  when (available si_mstr)
                  ""       when (not available si_mstr) @ si_desc
                  disp_abs_id @ abs_id.
            end.
         end.
         else
            if frame-field = "abs_id" then do:
            {mfnp05.i abs_mstr abs_id
               "abs_shipfrom = input abs_shipfrom and abs_id begins ""C""
                     and abs_type = ""S"" "
               abs_id
               " ""c"" + input abs_id"}
            if recno <> ? then do:
               find si_mstr where si_site = abs_shipfrom
               no-lock no-error.
               assign
                  disp_abs_id = substring(abs_id,2,8).
               display
                  abs_shipfrom
                  si_desc  when (available si_mstr)
                  ""       when (not available si_mstr) @ si_desc
                  disp_abs_id @ abs_id.
            end.
         end.
         else do:
            status input.
            readkey.
            apply lastkey.
         end.
      end.

      find si_mstr where si_site = input abs_shipfrom no-lock no-error.

      if not available si_mstr then do:
         /* Site does not exist */
         {pxmsg.i &MSGNUM=708 &ERRORLEVEL=3}   /* SITE DOES NOT EXIST */
         next-prompt abs_shipfrom.
         undo, retry.
      end.

      {gprun.i ""gpsiver.p""
         "(input si_site,
           input recid(si_mstr),
           output return_int)"}
/*GUI*/ if global-beam-me-up then undo, leave.


      if return_int = 0 then do:
         /* User does not have access to this site */
         {pxmsg.i &MSGNUM=725 &ERRORLEVEL=3}
         next-prompt abs_shipfrom.
         undo mainloop, retry.
      end.

      run get_abs_parent
         (input "C" + input frame a abs_mstr.abs_id,
          input frame a abs_mstr.abs_shipfrom,
          output par_absid,
          output par_shipfrom).

      if par_absid <> ? then do for abs_tmp:
         find abs_tmp where
              abs_tmp.abs_id = par_absid and
              abs_tmp.abs_shipfrom = par_shipfrom
         no-lock no-error.
         if available abs_tmp and abs_tmp.abs_inv_mov <> "" then do:
            /* Parent shipper has Inventory Movement Code. Use workbench */
            {pxmsg.i &MSGNUM=5972 &ERRORLEVEL=4}
            undo mainloop, retry mainloop.
         end.
      end. /* if par_absid <> ? */

      display si_desc.

      if input abs_id = "" then do:

         find mfc_ctrl where mfc_field = "rcc_next_ctnr"
         exclusive-lock.

         do while can-find(abs_mstr
                     where abs_shipfrom = input abs_shipfrom
                       and abs_id = "C" + string(mfc_integer,"99999999")):
            mfc_integer = mfc_integer + 1.
            if mfc_integer >= 100000000 then mfc_integer = 1.
         end.

         display
            string(mfc_integer,"99999999") @ abs_id.

         mfc_integer = mfc_integer + 1.
         if mfc_integer >= 100000000 then mfc_integer = 1.

      end.

   end.
/*GUI*/ if global-beam-me-up then undo, leave.


   release mfc_ctrl.

   do transaction:
/*GUI*/ if global-beam-me-up then undo, leave.


      find abs_mstr where
           abs_shipfrom = input frame a abs_shipfrom and
           abs_id = "C" + input frame a abs_id
      exclusive-lock no-error.

      if available abs_mstr and
         abs_type <> "s"
      then do:
         /* SELECTED CONTAINER HAS INVALID TYPE */
         {pxmsg.i &MSGNUM=5813 &ERRORLEVEL=3}
         next-prompt abs_id with frame a.
         undo mainloop, retry mainloop.
      end.

      if not available abs_mstr then do:

         {pxmsg.i &MSGNUM=1 &ERRORLEVEL=1}   /* ADDING NEW RECORD */

         create abs_mstr.
         assign
            abs_shipfrom = input frame a abs_shipfrom
            abs_id = "c" + input frame a abs_id.

         assign
            abs_qty = 1
            abs_shp_date = today
            abs_type = "s".
      end.

      find ad_mstr where ad_addr = abs_shipto no-lock no-error.

      clear frame b.
/*GUI*/ RECT-FRAME-LABEL:SCREEN-VALUE in frame b = F-b-title.

      display
         abs_shipto
         ad_name      when (available ad_mstr)
         ad_line1     when (available ad_mstr)
      with frame b.

      do for abs_mstr_par:
         find abs_mstr_par
         where abs_mstr_par.abs_shipfrom = abs_mstr.abs_shipfrom
           and abs_mstr_par.abs_id = abs_mstr.abs_par_id
         no-lock no-error.
         if available abs_mstr_par then do:
            /* This is subordinate to */
            {pxmsg.i &MSGNUM=8102 &ERRORLEVEL=1 &MSGARG1=abs_id}
         end.
      end.

      if can-find(first abs_mstr_cont
                  where abs_mstr_cont.abs_shipfrom = abs_mstr.abs_shipfrom
                    and abs_mstr_cont.abs_par_id = abs_mstr.abs_id)
            or can-find(abs_mstr_cont
                  where abs_mstr_cont.abs_shipfrom = abs_mstr.abs_shipfrom
                    and abs_mstr_cont.abs_par_id = abs_mstr.abs_id)
      then do:
            {pxmsg.i &MSGNUM=8103 &ERRORLEVEL=1}
            /* CONTENTS (CONTAINER OR ITEM) EXIST */
      end.

      else do on error undo, retry on endkey undo mainloop,
      retry mainloop with frame b:
/*GUI*/ if global-beam-me-up then undo, leave.


         {rcshmta.i}
         if (using_container_charges or
            using_line_charges) then
             run CreateUserFields
                      (input abs_mstr.abs_id,
                       input abs_mstr.abs_shipfrom,
                       input abs_mstr.abs_shipto).
      end.
/*GUI*/ if global-beam-me-up then undo, leave.


      ststatus = stline[3].
      status input ststatus.

      find pt_mstr where pt_part = abs_item no-lock no-error.

      display
         abs_item
         pt_desc1  when (available pt_mstr)
         abs_qty
         abs_site
         abs_loc
         abs_lotser
         abs_order when (using_container_charges or using_line_charges)
         abs_line  when (using_container_charges or using_line_charges)
      with frame c.

      /* FORCE THE CONTROL TO FALL THROUGH ON END-ERROR (F4), HIDE THE FRAME,*/
      /* AND THEN DO THE NORMAL END-ERROR PROCESSING OF UPDATE               */
      set1:
      do on error undo, retry on endkey undo set1 , leave set1
      with frame c:
/*GUI*/ if global-beam-me-up then undo, leave.


         set
            abs_item.

         new_site = abs_shipfrom.
         global_part = abs_item.

         /* CHECK ITEM EXISTENCE IN REMOTE DB*/
         {gprun.i ""gpptsi01.p""}
/*GUI*/ if global-beam-me-up then undo, leave.


         if err_stat <> 0 then do:
            /* Item does not exist at this site */
            {pxmsg.i &MSGNUM=715 &ERRORLEVEL=3}
            undo, retry.
         end.

         find pt_mstr where pt_part = abs_item no-lock no-error.
         if not available pt_mstr then do:
            /* Item Number does not exist */
            {pxmsg.i &MSGNUM=16 &ERRORLEVEL=3}
            undo, retry.
         end.
         if using_container_charges then do:
            for first ptc_det
               where ptc_part = input frame c abs_item no-lock:
            end.

            if not available ptc_det then do:
               /*ITEM HAS NOT BEEN DEFINED AS A CONTAINER*/
               run p-pxmsg (input 4447,
                            input 3,
                            input "",
                            input "",
                            input "").
               undo, retry.
            end. /*IF NOT AVAILABLE PTC_DET THEN DO*/
         end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /*IF USING_CONTAINER_CHARGES*/

         if new abs_mstr then do:
            assign
               abs_site = abs_shipfrom
               abs_loc = pt_loc.

            display
               abs_site
               abs_loc.

         end.

         display pt_desc1.

         global_part = abs_item.

         set2:
         do on error undo set2,retry set2:
/*GUI*/ if global-beam-me-up then undo, leave.

            set
               abs_qty
               abs_site
               abs_loc
               abs_lotser
               abs_ref
               abs_order when (using_container_charges or using_line_charges)
               abs_line  when (using_container_charges or using_line_charges)

            editing:
               assign
                  global_site = input abs_site
                  global_loc = input abs_loc
                  global_lot = input abs_lotser.
               if frame-field <> "" then vLastField = frame-field.
               readkey.
               apply lastkey.
               if (using_container_charges or using_line_charges) and
                  (go-pending or(vLastField <> frame-field))
                  then do:

                  if can-find(first absd_det where
                     absd_abs_id = abs_id
                     and absd_shipfrom = abs_shipfrom
                     and absd_abs_fld_name = vLastField
                     and absd_fld_prompt = yes)
                     then do:
                  /*Update user defined fields for specific shipper field*/
                     {gprunmo.i
                              &module = "ACL"
                              &program = ""rcswbuf.p""
                              &param   = """(input yes,
                                             input vLastField,
                                             input abs_id,
                                             input abs_shipfrom)"""}
                     if vLastField = frame-field then leave.
                   end. /*IF CAN-FIND*/
               end. /*IF (using_container_charges..or..GO-PENDING OR*/

            end.

            /* ADDED UM CONV AS TENTH INPUT PARAMETER ;  */
            /* PASSING ZERO                              */
            {gprun.i ""rcctmtb.p""
               "(input transtype,
                 input abs_shipfrom,
                 input abs_site,
                 input abs_loc,
                 input abs_item,
                 input abs_lotser,
                 input abs_ref,
                 input abs_qty,
                 input pt_um,
                 input 0,
                 output undotran)"}
/*GUI*/ if global-beam-me-up then undo, leave.


            if undotran then undo, retry.
            if using_container_charges or using_line_charges then do:
               /* VALIDATE SALES ORDER AND ORDER LINE  */
               if abs_order <> "" or abs_line <> "" then do:
                  if not can-find(so_mstr where so_nbr = abs_order)
                  then do:
                  /*SALES ORDER DOES NOT EXIST*/
                     run p-pxmsg (INPUT 609,
                                  INPUT 3,
                                  INPUT "",
                                  INPUT "",
                                  INPUT "").
                     next-prompt abs_order with frame c.
                     undo, retry.
                  end.
                  if not can-find(sod_det where sod_nbr = abs_order
                     and sod_line = integer(abs_line)) then do:
                     /*SALES ORDER LINE DOES NOT EXIST*/
                        run p-pxmsg (INPUT 764,
                                     INPUT 3,
                                     INPUT "",
                                     INPUT "",
                                     INPUT "").
                     next-prompt abs_line with frame c.
                     undo, retry.
                  end.
               end. /*IF ABS_ORDER <> ??  ...*/
            end. /*IF USING_CONTAINER_CHARGES OR USING_LINE_CHARGES*/

         end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /*set2*/

      end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* set1 */

      hide frame c.
      if using_container_charges or using_line_charges then do:
         if keyfunction(lastkey) = 'END-ERROR' and
          frame-name = "c" then
          undo mainloop, retry mainloop.
      end.
      else
         if keyfunction(lastkey) = "END-ERROR" then
         undo mainloop, retry mainloop.

      if new abs_mstr then do:

         assign
            abs_wt_um     = if pt_ship_wt_um <> "" then
                               pt_ship_wt_um
                            else
                               pt_net_wt_um
            abs_vol_um    = pt_dim_um
            l_abs_tare_wt = if pt_ship_wt > pt_net_wt then
                               pt_ship_wt
                            else
                               pt_net_wt
            abs_gwt       = (if pt_ship_wt > pt_net_wt then
                                pt_ship_wt
                             else pt_net_wt)
                                  * abs_qty.

         {abspack.i "abs_mstr" 26 22 "l_abs_tare_wt" }

      end.

      abs_recid = recid(abs_mstr).

   end.
/*GUI*/ if global-beam-me-up then undo, leave.


   find abs_mstr where recid(abs_mstr) = abs_recid no-lock.

   old_nwt = abs_nwt.
   old_gwt = abs_gwt.
   old_vol = abs_vol.

   /* MAINTAIN CONTAINERS */
   {gprun.i ""rcshmta.p"" "(input abs_recid)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   /* MAINTAIN ITEMS */
   {gprun.i ""rcshmtb.p"" "(input abs_recid, input no)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   {gprun.i ""rcctmtc.p"" "(input recid(abs_mstr))"}
/*GUI*/ if global-beam-me-up then undo, leave.


   /* UPDATE WEIGHTS AND VOLUME */
   {gprun.i ""rcshmtc.p"" "(input abs_recid)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   /* PROPAGATE CHANGE IN WEIGHTS OR VOL UP THRU PARENTS */
   diff_nwt = abs_nwt - old_nwt.
   diff_gwt = abs_gwt - old_gwt.
   diff_vol = abs_vol - old_vol.

   {gprun.i ""rcshmtd.p""
      "(input abs_shipfrom,
        input abs_par_id,
        input diff_nwt,
        input diff_gwt,
        input diff_vol)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   if (using_container_charges or using_line_charges)
   then do:
      if can-find(first absd_det where
         absd_abs_id = abs_id
         and absd_shipfrom = abs_shipfrom
         and absd_abs_fld_name = ""
         and absd_fld_prompt = yes)
         then do:
         /* Update user defined fields for non specific shipper field */
         {gprunmo.i
                   &module = "ACL"
                   &program = ""rcswbuf.p""
                   &param   = """(input no,
                                  input "''",
                                  input abs_id,
                                  input abs_shipfrom)"""}
      end. /*IF CAN-FIND*/
   end. /*IF (USING_CONTAINER*/

   /* GET ANY SPECIAL BARCODE DATA AND/OR TEXT */
   {gprun.i ""rcctmta.p"" "(input recid(abs_mstr))"}
/*GUI*/ if global-beam-me-up then undo, leave.


   assign
     global_recid = recid(abs_mstr).

end.

/* Internal procedures to get parent abs record, check
invoice consolidation feasibility, etc */
{rcinvcon.i}

PROCEDURE CreateUserFields:
   /* Purpose: Calls a standard program which creates user defined
    *          fields for the line on the shipper. These pre-defined
    *          fields were created using one of the control file
    *          maintenance programs. If no fields are defined in the
    *          control files none will be created.
    */

   define input parameter ipAbsId like abs_id no-undo.
   define input parameter ipAbsShipFrom like abs_shipfrom no-undo.
   define input parameter ipAbsShipTo like abs_shipto no-undo.
   /* CREATE LINE LEVEL USER FIELD RECORDS */
   {gprunmo.i
             &program = ""sosob1b.p""
             &module  = "ACL"
             &param   = """(input ipAbsId,
                            input ipAbsShipFrom,
                            input ipAbsShipTo,
                            input 2)"""}

END PROCEDURE. /*CreateUserFields*/

PROCEDURE p-pxmsg:
   /*Purpose: Message handling. This procedure was created do to
    *         action segment errors.
    */
   define input parameter ipMsgNbr as integer no-undo.
   define input parameter ipErrorLevel as integer no-undo.
   define input parameter ipMsg1 as character no-undo.
   define input parameter ipMsg2 as character no-undo.
   define input parameter ipMsg3 as character no-undo.

   {pxmsg.i &MSGNUM=ipMsgNbr
            &ERRORLEVEL=ipErrorLevel
            &MSGARG1=ipMsg1
            &MSGARG2=ipMsg2
            &MSGARG3=ipMsg3 }
END PROCEDURE.
